module.exports = {
    name: "PageVisitTime",
    viewName: 'PageVisitTime',
    primaryKey: "Id",
    properties: getProperties(),
    pagesDataSource: getPagesDataSource(),
    timeTypeDataSource: getTimeTypeDataSource()
}

function getProperties() {
    return [
        getProperty("Id", "Id"),
        getProperty("TimePoint", "时间点"),
        getProperty("SecondTypeCount1", "30秒以下浏览量"),
        getProperty("SecondTypeCount2", "30-60秒浏览量"),
        getProperty("SecondTypeCount3", "1-5分种浏览量"),
        getProperty("SecondTypeCount4", "5-10分钟浏览量"),
        getProperty("SecondTypeCount5", "10分钟以上浏览量")
    ]
}

function getProperty(name, label) { return { name, label } }

function getPagesDataSource() {
    return {
        valueName: "PageId",
        textName: "Name",
        stateName: "getPages",
        serviceName: "PageVisitService",
        actionName: "getPages"
    }
}

function getTimeTypeDataSource() {
    return [{ value: 1, text: "半小时" }, { value: 2, text: "一小时" }, { value: 3, text: "一天" }]
}